#!/bin/sh
#
# Creates a classpath out of the contents of each directory
# given as an argument.

[[ $# == 0 ]] && { echo "Usage: $0 [dir1 dir2 ...]" && exit 0; }

sdir=$(dirname $0)
cp=""

for dir in "$@" ; do
  for x in $($sdir/abspath $dir)/* ; do
    cp="$cp:$($sdir/abspath $x)"
  done
done

# shaving the : off the beginning.
echo ${cp#:}
